<?php
namespace UHU;
abstract class CallbackProcess
{
	protected $success_callbacks;
	protected $failure_callbacks;
	public function __construct()
	{
		$this->success_callbacks = new \UHU\Collection\Callbacks($this);
		$this->failure_callbacks = new \UHU\Collection\Callbacks($this);
	}
	public function add_success($callback)
	{
		$this->success_callbacks[] = $callback;
	}
	public function add_failure($callback)
	{
		$this->failure_callbacks[] = $callback;
	}
	public function succeeded()
	{
		$this->success_callbacks->doCallbacks();
	}
	public function failed()
	{
		$this->failure_callbacks->doCallbacks();
	}
}
namespace UHU\CallbackProcess;
abstract class RunOnce extends \UHU\CallbackProcess
{
	public function __construct()
	{
		$this->success_callbacks = new \UHU\Collection\Callbacks\RunOnce($this);
		$this->failure_callbacks = new \UHU\Collection\Callbacks\RunOnce($this);
	}
}
?>